define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.sign_deploy/index',
        add_url: 'user.sign_deploy/add',
        edit_url: 'user.sign_deploy/edit',
        delete_url: 'user.sign_deploy/delete',
        export_url: 'user.sign_deploy/export',
        modify_url: 'user.sign_deploy/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: '主键id'},
                    {field: 'day', title: '签到天数'},
                    {field: 'earn_point', title: '签到获取积分'},
                    {field: 'sign_num', title: '签到天数'},
                    {field: 'is_status', selectList:  {0: '显示', 1: '隐藏'}, title: '是否可用', templet: ea.table.switchs},
                    {field: 'sort', title: '排序', edit: 'text'},
                    {width: 150, title: '操作', templet: ea.table.tool},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});